/**
 * 易信sdk
 */
var YiXinUtil = {};
/**
 * 接收到反馈
 * @param code
 */
YiXinUtil.receiveResponse = function (code) {
};
/**
 * 是否安装
 * @return {Boolean}
 * @public
 */
YiXinUtil.isInstalled = function () {
    if (cc.sys.os == cc.sys.OS_IOS) {
        return jsb.reflection.callStaticMethod('YiXinUtil', 'isInstalled');
    } else if (cc.sys.os == cc.sys.OS_ANDROID) {
        return jsb.reflection.callStaticMethod(packageUri + '/utils/YiXinUtil', 'isInstalled', '()Z');
    }
};
/**
 * 分享网址
 * @param {String} url
 * @param {String} title
 * @param {String} description
 * @param {Number} sceneType 分享场景
 * @public
 */
YiXinUtil.shareUrl = function (url, title, description, sceneType) {
    sceneType = sceneType || YiXinUtil.SceneType.Session;
    if (cc.sys.os == cc.sys.OS_IOS) {
        jsb.reflection.callStaticMethod(
            'YiXinUtil',
            'shareUrl:title:description:sceneType:',
            url, title, description, sceneType
        );
    } else if (cc.sys.os == cc.sys.OS_ANDROID) {
        jsb.reflection.callStaticMethod(
            packageUri + '/utils/YiXinUtil',
            'shareUrl', '(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V',
            url, title, description, sceneType
        );
    }
};
/**
 * 分享网址
 * @param {String} url
 * @param {String} title
 * @param {String} description
 * @param {String} path
 * @param {Number} [sceneType] 分享场景
 * @public
 */
YiXinUtil.shareUrlWithIcon = function (url, title, description, path, sceneType) {
    sceneType = sceneType || YiXinUtil.SceneType.Session;
    if (cc.sys.os == cc.sys.OS_IOS) {
        jsb.reflection.callStaticMethod(
            'YiXinUtil',
            'shareUrlWithIcon:title:description:path:sceneType:',
            url, title, description, path, sceneType
        );
    } else if (cc.sys.os == cc.sys.OS_ANDROID) {
        jsb.reflection.callStaticMethod(
            packageUri + '/utils/YiXinUtil',
            'shareUrlWithIcon', '(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V',
            url, title, description, path, sceneType
        );
    }
};
/**
 * 分享图片
 * @param {String} path
 * @param {Number} [sceneType]
 * @public
 */
YiXinUtil.sharePic = function (path, sceneType) {
    sceneType = sceneType || YiXinUtil.SceneType.Session;
    if (cc.sys.os == cc.sys.OS_IOS) {
        jsb.reflection.callStaticMethod(
            'YiXinUtil',
            'sharePic:sceneType:',
            path, sceneType
        );
    } else if (cc.sys.os == cc.sys.OS_ANDROID) {
        jsb.reflection.callStaticMethod(
            packageUri + '/utils/YiXinUtil',
            'sharePic', '(Ljava/lang/String;I)V',
            path, sceneType
        );
    }
};
/**
 * 截图
 * @param {cc.Node} node
 * @param {Number} [sceneType]
 * @public
 */
YiXinUtil.shareCapture = function (node, sceneType) {
    sceneType = sceneType || YiXinUtil.SceneType.Session;
    captureNode(node, function (path) {
        YiXinUtil.sharePic(path, sceneType);
    });
};
/**
 * 分享文本
 * @param {String} text
 * @param {Number} [sceneType]
 */
YiXinUtil.shareText = function (text, sceneType) {
    sceneType = sceneType || YiXinUtil.SceneType.Session;
    if (cc.sys.os == cc.sys.OS_IOS) {
        jsb.reflection.callStaticMethod(
            'YiXinUtil',
            'shareText:sceneType:',
            text, sceneType
        );
    } else if (cc.sys.os == cc.sys.OS_ANDROID) {
        jsb.reflection.callStaticMethod(
            packageUri + '/utils/YiXinUtil',
            'shareText', '(Ljava/lang/String;I)V',
            text, sceneType
        );
    }
};
/**
 * 场景定义
 * @public
 */
YiXinUtil.SceneType = {
    Session: 0,
    Timeline: 1,
    Favorite: 2
};